package com.hz.friends.group;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

import com.hz.friends.activity.BaseActivity;
import com.hz.friends.activity.R;

public class GroupCategorySelectActivtiy extends BaseActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_groupcategoryselect);
		initactionbar();
	}

	@Override
	protected void init() {

	}
	private void initactionbar() {
		ImageButton imbtn_bar_left = (ImageButton) findViewById(R.id.imbtn_bar_left);
		ImageButton imbtn_bar_right = (ImageButton) findViewById(R.id.imbtn_bar_right);
		TextView imbtn_bar_title = (TextView) findViewById(R.id.imbtn_bar_title);
		imbtn_bar_right.setVisibility(View.INVISIBLE);
		imbtn_bar_left.setImageResource(R.drawable.ic_leftback_arrow);
		imbtn_bar_title.setText("Select a category");
		imbtn_bar_left.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
               finish();				
			}
		});
	}
	
	@Override
	protected void initViews() {
		ImageButton imbtn_bar_left = (ImageButton) findViewById(R.id.imbtn_bar_left);
		ImageButton imbtn_bar_right = (ImageButton) findViewById(R.id.imbtn_bar_right);
		TextView imbtn_bar_title = (TextView) findViewById(R.id.imbtn_bar_title);
		imbtn_bar_title.setText("select Category");
		imbtn_bar_right.setVisibility(View.GONE);
		imbtn_bar_left.setImageResource(R.drawable.ic_leftback_arrow);
	}

	@Override
	protected void setViews() {

	}

	@Override
	protected void initEvents() {

	}
	
	public void onClick(View view){
		Intent	intent = new Intent(this, CreateGroupActivity.class);
		switch (view.getId()) {
		case R.id.imbtn_bar_left:
			finish();
			break;
		case R.id.layout1:
             intent.putExtra("type", 1);			
             intent.putExtra("activitytype", 0);			
			break;
		case R.id.layout2:
            intent.putExtra("type", 2);		
            intent.putExtra("activitytype", 0);			
			break;
		case R.id.layout3:
            intent.putExtra("type", 3);		
            intent.putExtra("activitytype", 0);			
			break;
		case R.id.layout4:
            intent.putExtra("type", 4);		
            intent.putExtra("activitytype", 0);			
			break;
		case R.id.layout5:
            intent.putExtra("type", 5);		
            intent.putExtra("activitytype", 0);			
			break;
		default:
			break;
		}
		startActivity(intent);
		finish();
	}

}
